#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
const int N = 1e5 + 10;
int n, m, k;
int a[N];
int d[N];
int find(int x)
{
	int l = 0, r = n + 1;
	while (l + 1 < r) {
		int mid = l + r >> 1;
		if (a[mid] <= x)l = mid;
		else r = mid;
	}
	return l;
}
int find1(int x)
{
	int l = 0, r = n + 1;
	while (l + 1 < r) {
		int mid = l + r >> 1;
		if (a[mid] <= x)l = mid;
		else r = mid;
	}
	return l;
}
int main()
{
	int t = 1;
	while (scanf("%d%d%d", &n, &m, &k) != EOF) {
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
			d[i] = 0;
		}
		d[n + 1] = 0;
		sort(a + 1, a + n + 1);
		int idx1 = 1, idx2 = 1;
		while (m--) {
			int x, y;
			cin >> x >> y;
			idx2 = find(x);
			//cout<<"idx1=="<<idx1<<endl;
			//cout<<"idx2=="<<idx2<<endl;
			if (idx1 <= idx2 && idx1 >= 1 && idx2 <= n) {
				d[idx1]++;
				d[idx2 + 1]--;
			}
			idx1 = find1(y) + 1;
		}
		int ans = 0;
		for (int i = 1; i <= n; i++) {
			d[i] += d[i - 1];
			if (d[i] >= k) {
				//cout<<"d[i]=="<<d[i]<<endl;
				ans++;
			}
		}
		cout << "Case " << t << ": " << ans << endl;
		t++;
	}
	return 0;
}